package com.beaven.model.data.message;

import com.beaven.model.data.BaseDbRepository;
import com.beaven.model.data.DbDataSource;
import com.beaven.model.model.db.Session;
import com.beaven.model.model.db.Session_Table;
import com.raizlabs.android.dbflow.sql.language.SQLite;
import java.util.List;

/**
 * author: Beaven
 * time: 2017/6/1 15:33
 */

public class SessionRepository extends BaseDbRepository<Session> implements DbDataSource<Session> {

  @Override public void load(SuccessCallBack<List<Session>> callBack) {
    super.load(callBack);
    SQLite.select()
        .from(Session.class)
        .limit(100)
        .orderBy(Session_Table.modifyAt, false)
        .async()
        .queryListResultCallback(this)
        .execute();
  }

}
